package com.minibobbo.utilities.spe;

import com.badlogic.gdx.utils.Array;
import com.minibobbo.utilities.extrectangle.eRectangle;
import com.minibobbo.utilities.spe.interactions.SpeInteraction;

public abstract class SpeObject {

	enum SpeObjectType {
		staticObj, dynamicObj, staticObject, 
	}

	public SpeObjectType SpeObjType;
	public eRectangle loc;

	private Object userData;
	// Object data variables
	protected String primaryData;
	protected Array<String> secondaryData;

	
	
	public void initObjectVariables() {
		secondaryData = new Array<String>();
		loc = new eRectangle();
	}
	
	
	public boolean isDynamicObject() {
		if (SpeObjType == SpeObjectType.dynamicObj)
			return true;
		else
			return false;
	}

	public void setPrimaryData(String data) {
		primaryData = data;
	}

	public void setSecondaryData(String data) {
		secondaryData.add(data);
	}

	public boolean isPrimaryData(String data) {
		if (data == primaryData)
			return true;
		else
			return false;
	}

	public boolean isSecondaryData(String data) {
		if (secondaryData.contains(data, true))
			return true;
		else
			return false;
	}

	
	/**
	 * Sets the user data variable. This can be retrieved by the getUserData
	 * method.
	 * 
	 * @param userData
	 *            The user data to be stored.
	 */
	public void setUserData(Object userData) {
		this.userData = userData;
	}

	/**
	 * Gets the user data stored by the setUserData method.
	 * @return The user data previously stored.  Null if empty.
	 */
	public Object getUserData() {
		return userData;
	}

}
